package com.ruoyi.yf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yf.mapper.YfOutstoreRecordMapper;
import com.ruoyi.yf.domain.YfOutstoreRecord;
import com.ruoyi.yf.service.IYfOutstoreRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 医废出库记录Service业务层处理
 * 
 * @author XiaoYi...
 * @date 2020-07-21
 */
@Service
public class YfOutstoreRecordServiceImpl implements IYfOutstoreRecordService 
{
    @Autowired
    private YfOutstoreRecordMapper yfOutstoreRecordMapper;

    /**
     * 查询医废出库记录
     * 
     * @param codeid 医废出库记录ID
     * @return 医废出库记录
     */
    @Override
    public YfOutstoreRecord selectYfOutstoreRecordById(String codeid)
    {
        return yfOutstoreRecordMapper.selectYfOutstoreRecordById(codeid);
    }

    /**
     * 查询医废出库记录列表
     * 
     * @param yfOutstoreRecord 医废出库记录
     * @return 医废出库记录
     */
    @Override
    public List<YfOutstoreRecord> selectYfOutstoreRecordList(YfOutstoreRecord yfOutstoreRecord)
    {
        return yfOutstoreRecordMapper.selectYfOutstoreRecordList(yfOutstoreRecord);
    }

    /**
     * 新增医废出库记录
     * 
     * @param yfOutstoreRecord 医废出库记录
     * @return 结果
     */
    @Override
    public int insertYfOutstoreRecord(YfOutstoreRecord yfOutstoreRecord)
    {
        yfOutstoreRecord.setCreateTime(DateUtils.getNowDate());
        return yfOutstoreRecordMapper.insertYfOutstoreRecord(yfOutstoreRecord);
    }

    /**
     * 修改医废出库记录
     * 
     * @param yfOutstoreRecord 医废出库记录
     * @return 结果
     */
    @Override
    public int updateYfOutstoreRecord(YfOutstoreRecord yfOutstoreRecord)
    {
        yfOutstoreRecord.setUpdateTime(DateUtils.getNowDate());
        return yfOutstoreRecordMapper.updateYfOutstoreRecord(yfOutstoreRecord);
    }

    /**
     * 删除医废出库记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYfOutstoreRecordByIds(String ids)
    {
        return yfOutstoreRecordMapper.deleteYfOutstoreRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除医废出库记录信息
     * 
     * @param codeid 医废出库记录ID
     * @return 结果
     */
    @Override
    public int deleteYfOutstoreRecordById(String codeid)
    {
        return yfOutstoreRecordMapper.deleteYfOutstoreRecordById(codeid);
    }

    // 部分医废(一批医废一次未出完)出库记录
    @Override
    public void saveOutRecordList(List<YfOutstoreRecord> outrecordList) {
        yfOutstoreRecordMapper.saveOutRecordList(outrecordList);
    }

}
